Dynomotion

Group: DynoMotion Message: 269 From: babinda01 Date: 3/28/2010
Subject: Fault Inputs
Hi Tom

I have run my machine all day and I have had nice smooth motion and no positional errors, so it looks like the problem is solved.

I am just tidying up a few things and am hoping you can help. In my init program I have the following loop, for my enable circuit.
Could you please look at it and see if there is a neater/better way of doing it.
It does work, but I am just not sure it is the correct way of doing things. The SetBit(159) at the end has me worried. To clear a fault from my drives I need to send an enable signal. So to get out of an estop situation, I need to send an enable signal.
But with what I have below it is possible to have mach NOT outputing an enable 1 signal, but because the estop button isn't pressed or an axis hasn't faulted then the enable relay is forced on (not very good practice).

for(;;)
{
WaitNextTimeSlice();

if (ReadBit(144) == ACTIVE_STATE) //Reads the Enable 1 output from mach3.
{
SetBit(159); //Sets my enable relay on
}
else if (Debounce(ReadBit(144) != ACTIVE_STATE))
{
ClearBit(159);//Sets my enable relay off }

if (!ReadBit(139)||ReadBit(140)||ReadBit(141)||ReadBit(142)||ReadBit(143)== ACTIVE_STATE) //if e/stop or Axis fault or spindle fault disable outputs
{
SetBit(49); //EStop input in mach3
}
else
{
ClearBit(49);
SetBit(159); //Sets my enable relay on

}


Regards
Andrew
Group: DynoMotion Message: 272 From: Tom Kerekes Date: 3/29/2010
Subject: Re: Fault Inputs
Hi Andrew,
 
Sorry I'm having a hard time following all that.
 
Bit to clear a fault from your drives don't you need to push RESET in Mach3?  In this case maybe you can put the SetBit(159); at the beginning of the Init program (before this loop) ??
 
Regards
TK

Group: DynoMotion Message: 277 From: babinda01 Date: 3/29/2010
Subject: Re: Fault Inputs
Hi Tom

Don't be sorry, I have trouble understanding myself sometimes.

I have that issue sorted anyway.

I have just one more question (for now!).... When I press my estop button, which is connected through to machs estop input. You can see that the machine goes into it's estop state (the reset led flashes) but I don't think is is actually doing the same thing as pressing the reset button on the mach screen.
My thinking behind this is that if you press the reset button on the screen, a message saying that the estop button is pressed flashes up in the status label (very briefly), but if you press the estop button this doesn't happen even though the reset led starts flashing. Also if you are doing a homing proceedure and you press the reset button the motion stops and the dro's stop counting but when you press the estop button the motion stops but the dro's keep counting.

Any thoughts???


Regards
Andrew

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Andrew,
>
> Sorry I'm having a hard time following all that.
>
> Bit to clear a fault from your drives don't you need to push RESET in Mach3?  In this case maybe you can put the SetBit(159); at the beginning of the Init program (before this loop) ??
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: babinda01 <a_k@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sun, March 28, 2010 10:48:27 PM
> Subject: [DynoMotion] Fault Inputs
>
>  
> Hi Tom
>
> I have run my machine all day and I have had nice smooth motion and no positional errors, so it looks like the problem is solved.
>
> I am just tidying up a few things and am hoping you can help. In my init program I have the following loop, for my enable circuit.
> Could you please look at it and see if there is a neater/better way of doing it.
> It does work, but I am just not sure it is the correct way of doing things. The SetBit(159) at the end has me worried. To clear a fault from my drives I need to send an enable signal. So to get out of an estop situation, I need to send an enable signal.
> But with what I have below it is possible to have mach NOT outputing an enable 1 signal, but because the estop button isn't pressed or an axis hasn't faulted then the enable relay is forced on (not very good practice).
>
> for(;;)
> {
> WaitNextTimeSlice( );
>
> if (ReadBit(144) == ACTIVE_STATE) //Reads the Enable 1 output from mach3.
> {
> SetBit(159); //Sets my enable relay on
> }
> else if (Debounce(ReadBit( 144) != ACTIVE_STATE) )
> {
> ClearBit(159) ;//Sets my enable relay off }
>
> if (!ReadBit(139) ||ReadBit( 140)||ReadBit( 141)||ReadBit( 142)||ReadBit( 143)== ACTIVE_STATE) //if e/stop or Axis fault or spindle fault disable outputs
> {
> SetBit(49); //EStop input in mach3
> }
> else
> {
> ClearBit(49) ;
> SetBit(159); //Sets my enable relay on
>
> }
>
> Regards
> Andrew
>
Group: DynoMotion Message: 279 From: Tom Kerekes Date: 4/2/2010
Subject: Re: Fault Inputs
Hi Andrew,
 
Did you ever resolve this?  I'm not sure I follow and Mach3 handles all the estop functionality, but it sounds like maybe the estop is just disabling your amplifiers and not really getting through to Mach3.
 
Regards
TK

Group: DynoMotion Message: 284 From: babinda01 Date: 4/4/2010
Subject: Re: Fault Inputs
Hi Tom,
No, I havn't sorted this one yet. The estop signal is definetly getting through to mach, on the diagnostics screen you can see the "estop" led toggle and you can also see the "reset" led start blinking, and as a result of this you can see the enable1 led go out and this in turn disables my servo's. BUT..... the DRO's keep moving if the homing "c" program is being run. But if you click the reset button with the mouse, the estop behaves correctly.
It is a little odd - I will being some more tests tomorrow.

Regards
Andrew

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Andrew,
>
> Did you ever resolve this?  I'm not sure I follow and Mach3 handles all the estop functionality, but it sounds like maybe the estop is just disabling your amplifiers and not really getting through to Mach3.
>
> Regards
> TK
>
>
>
>
> ________________________________
> From: babinda01 <a_k@...>
> To: DynoMotion@yahoogroups.com
> Sent: Mon, March 29, 2010 7:43:59 PM
> Subject: [DynoMotion] Re: Fault Inputs
>
>  
> Hi Tom
>
> Don't be sorry, I have trouble understanding myself sometimes.
>
> I have that issue sorted anyway.
>
> I have just one more question (for now!).... When I press my estop button, which is connected through to machs estop input. You can see that the machine goes into it's estop state (the reset led flashes) but I don't think is is actually doing the same thing as pressing the reset button on the mach screen.
> My thinking behind this is that if you press the reset button on the screen, a message saying that the estop button is pressed flashes up in the status label (very briefly), but if you press the estop button this doesn't happen even though the reset led starts flashing. Also if you are doing a homing proceedure and you press the reset button the motion stops and the dro's stop counting but when you press the estop button the motion stops but the dro's keep counting.
>
> Any thoughts???
>
> Regards
> Andrew
>
> --- In DynoMotion@yahoogro ups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Andrew,
> >
> > Sorry I'm having a hard time following all that.
> >
> > Bit to clear a fault from your drives don't you need to push RESET in Mach3?  In this case maybe you can put the SetBit(159);  at the beginning of the Init program (before this loop) ??
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ____________ _________ _________ __
> > From: babinda01 <a_k@>
> > To: DynoMotion@yahoogro ups.com
> > Sent: Sun, March 28, 2010 10:48:27 PM
> > Subject: [DynoMotion] Fault Inputs
> >
> >  
> > Hi Tom
> >
> > I have run my machine all day and I have had nice smooth motion and no positional errors, so it looks like the problem is solved.
> >
> > I am just tidying up a few things and am hoping you can help. In my init program I have the following loop, for my enable circuit.
> > Could you please look at it and see if there is a neater/better way of doing it.
> > It does work, but I am just not sure it is the correct way of doing things. The SetBit(159) at the end has me worried. To clear a fault from my drives I need to send an enable signal. So to get out of an estop situation, I need to send an enable signal.
> > But with what I have below it is possible to have mach NOT outputing an enable 1 signal, but because the estop button isn't pressed or an axis hasn't faulted then the enable relay is forced on (not very good practice).
> >
> > for(;;)
> > {
> > WaitNextTimeSlice( );
> >
> > if (ReadBit(144) == ACTIVE_STATE) //Reads the Enable 1 output from mach3.
> > {
> > SetBit(159); //Sets my enable relay on
> > }
> > else if (Debounce(ReadBit( 144) != ACTIVE_STATE) )
> > {
> > ClearBit(159) ;//Sets my enable relay off }
> >
> > if (!ReadBit(139) ||ReadBit( 140)||ReadBit( 141)||ReadBit( 142)||ReadBit( 143)== ACTIVE_STATE) //if e/stop or Axis fault or spindle fault disable outputs
> > {
> > SetBit(49); //EStop input in mach3
> > }
> > else
> > {
> > ClearBit(49) ;
> > SetBit(159); //Sets my enable relay on
> >
> > }
> >
> > Regards
> > Andrew
> >
>
Group: DynoMotion Message: 285 From: babinda01 Date: 4/4/2010
Subject: Re: Fault Inputs
Hi Tom
I have done a little more investigation in regard to my estop issue, and I think there are actually a couple of issues.

Firstly, if I am executing a homing routine via my GalHoming.c program and I press the estop button or the reset button on my mach screen, I need to reboot the kflop via the console to get the system working again. I am assuming this is because it is in the middle of a user "c" program when the estop occured that thread is still actually running. So, do I need to put something in my init program to clear any running threads????

Secondly, as I have mentioned before, if I press my external estop button, mach3 gets this command (I can see this by the status leds on my diagnostics page) but my dro's are still moving, but because mach have disabled my servo's I'm not getting any physical movement. So my question is, how does the kflop get the estop command from mach, is it by some sort of estop flag set by mach internally, or is it in response to an actual button press on the mach screen?

Regards
Andrew



--- In DynoMotion@yahoogroups.com, "babinda01" <a_k@...> wrote:
>
> Hi Tom,
> No, I havn't sorted this one yet. The estop signal is definetly getting through to mach, on the diagnostics screen you can see the "estop" led toggle and you can also see the "reset" led start blinking, and as a result of this you can see the enable1 led go out and this in turn disables my servo's. BUT..... the DRO's keep moving if the homing "c" program is being run. But if you click the reset button with the mouse, the estop behaves correctly.
> It is a little odd - I will being some more tests tomorrow.
>
> Regards
> Andrew
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi Andrew,
> >
> > Did you ever resolve this?  I'm not sure I follow and Mach3 handles all the estop functionality, but it sounds like maybe the estop is just disabling your amplifiers and not really getting through to Mach3.
> >
> > Regards
> > TK
> >
> >
> >
> >
> > ________________________________
> > From: babinda01 <a_k@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Mon, March 29, 2010 7:43:59 PM
> > Subject: [DynoMotion] Re: Fault Inputs
> >
> >  
> > Hi Tom
> >
> > Don't be sorry, I have trouble understanding myself sometimes.
> >
> > I have that issue sorted anyway.
> >
> > I have just one more question (for now!).... When I press my estop button, which is connected through to machs estop input. You can see that the machine goes into it's estop state (the reset led flashes) but I don't think is is actually doing the same thing as pressing the reset button on the mach screen.
> > My thinking behind this is that if you press the reset button on the screen, a message saying that the estop button is pressed flashes up in the status label (very briefly), but if you press the estop button this doesn't happen even though the reset led starts flashing. Also if you are doing a homing proceedure and you press the reset button the motion stops and the dro's stop counting but when you press the estop button the motion stops but the dro's keep counting.
> >
> > Any thoughts???
> >
> > Regards
> > Andrew
> >
> > --- In DynoMotion@yahoogro ups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Andrew,
> > >
> > > Sorry I'm having a hard time following all that.
> > >
> > > Bit to clear a fault from your drives don't you need to push RESET in Mach3?  In this case maybe you can put the SetBit(159);  at the beginning of the Init program (before this loop) ??
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > > ____________ _________ _________ __
> > > From: babinda01 <a_k@>
> > > To: DynoMotion@yahoogro ups.com
> > > Sent: Sun, March 28, 2010 10:48:27 PM
> > > Subject: [DynoMotion] Fault Inputs
> > >
> > >  
> > > Hi Tom
> > >
> > > I have run my machine all day and I have had nice smooth motion and no positional errors, so it looks like the problem is solved.
> > >
> > > I am just tidying up a few things and am hoping you can help. In my init program I have the following loop, for my enable circuit.
> > > Could you please look at it and see if there is a neater/better way of doing it.
> > > It does work, but I am just not sure it is the correct way of doing things. The SetBit(159) at the end has me worried. To clear a fault from my drives I need to send an enable signal. So to get out of an estop situation, I need to send an enable signal.
> > > But with what I have below it is possible to have mach NOT outputing an enable 1 signal, but because the estop button isn't pressed or an axis hasn't faulted then the enable relay is forced on (not very good practice).
> > >
> > > for(;;)
> > > {
> > > WaitNextTimeSlice( );
> > >
> > > if (ReadBit(144) == ACTIVE_STATE) //Reads the Enable 1 output from mach3.
> > > {
> > > SetBit(159); //Sets my enable relay on
> > > }
> > > else if (Debounce(ReadBit( 144) != ACTIVE_STATE) )
> > > {
> > > ClearBit(159) ;//Sets my enable relay off }
> > >
> > > if (!ReadBit(139) ||ReadBit( 140)||ReadBit( 141)||ReadBit( 142)||ReadBit( 143)== ACTIVE_STATE) //if e/stop or Axis fault or spindle fault disable outputs
> > > {
> > > SetBit(49); //EStop input in mach3
> > > }
> > > else
> > > {
> > > ClearBit(49) ;
> > > SetBit(159); //Sets my enable relay on
> > >
> > > }
> > >
> > > Regards
> > > Andrew
> > >
> >
>
Group: DynoMotion Message: 286 From: karmannelectric Date: 4/5/2010
Subject: Re: Fault Inputs
Sorry I'm not more help, but this sounds very familiar to a problem I had only on the A axis using a SmoothStepper (sorry, I didn't know about DynoMotion yet!) about a year ago. I forget too many details, but it only acted up on one computer, not any of the others I had used with SmoothStepper. If I remember correctly, sometimes it would also home backwards? But it was during homing, the motor wouldn't move (no pulses coming out), but Mach's DRO was still indicating motion.

Why am I posting this? Maybe it's a Mach problem when using external pulse generators.

Good luck,

- Steve

--- In DynoMotion@yahoogroups.com, "babinda01" <a_k@...> wrote:
>
> Hi Tom
> I have done a little more investigation in regard to my estop issue, and I think there are actually a couple of issues.
>
> Firstly, if I am executing a homing routine via my GalHoming.c program and I press the estop button or the reset button on my mach screen, I need to reboot the kflop via the console to get the system working again. I am assuming this is because it is in the middle of a user "c" program when the estop occured that thread is still actually running. So, do I need to put something in my init program to clear any running threads????
Group: DynoMotion Message: 287 From: Tom Kerekes Date: 4/5/2010
Subject: Re: Fault Inputs
Hi Andrew,
 
First to answer your question:  There is an internal EStop flag and also a MyReset function that gets called. 
 
It looks like we mainly only check for the EStop flag when Mach calls our MyReset function to determine if we should be going into reset or coming out of reset.
 
I see that we kill any "Notify" thread that might be left running when coming out of Reset, but not any "Home" threads.
 
I'm exactly not sure of the best solution.
 
I think the reason the DROs keep running is clear.  Once your Home routine issues a Jog Command to the axis, the axis will keep moving unless it is stopped either by disabling the axis or a stop (Jog(x,0)) command.   The home program is stuck waiting for the axis to hit the switch which never happens.  Note that killing the thread would not stop the motion because the Jog of the axis is in progress.
 
I'm thinking the safest solution might be to modify your home routine so that while it is looping waiting for the home switch it also checks the amp enables, and if it sees that they are disabled, issues a stop to the axis and exits?  I realize this puts more burden on the User program, but I find this is safer than killing threads unexpectedly.
 
Alternatively, I think you could add PauseThread(xx); commands into your Init program to kill the threads.  
 
What do you think?
 

Thanks

TK

 



Group: DynoMotion Message: 288 From: babinda01 Date: 4/5/2010
Subject: Re: Fault Inputs
Hi Tom

I have changed my homing program to 'OR' my enable1 output from mach, like this:
while (ReadBit(15) || (!ReadBit(144))) ;
But it doesn't pick up if I am not getting the enable1 signal. Is this the correct way to be doing this?

Andrew

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Andrew,
>
> First to answer your question:  There is an internal EStop flag and also a MyReset function that gets called. 
>
> It looks like we mainly only check for the EStop flag when Mach calls our MyReset function to determine if we should be going into reset or coming out of reset.
>
> I see that we kill any "Notify" thread that might be left running when coming out of Reset, but not any "Home" threads.
>
> I'm exactly not sure of the best solution.
>
> I think the reason the DROs keep running is clear.  Once your Home routine issues a Jog Command to the axis, the axis will keep moving unless it is stopped either by disabling the axis or a stop (Jog(x,0)) command.   The home program is stuck waiting for the axis to hit the switch which never happens.  Note that killing the thread would not stop the motion because the Jog of the axis is in progress.
>
> I'm thinking the safest solution might be to modify your home routine so that while it is looping waiting for the home switch it also checks the amp enables, and if it sees that they are disabled, issues a stop to the axis and exits?  I realize this puts more burden on the User program, but I find this is safer than killing threads unexpectedly.
>
> Alternatively, I think you could add PauseThread(xx); commands into your Init program to kill the threads.  
>
> What do you think?
>
> Thanks
> TK
>  
>
>
>
>
> ________________________________
> From: babinda01 <a_k@...>
> To: DynoMotion@yahoogroups.com
> Sent: Sun, April 4, 2010 4:45:42 PM
> Subject: [DynoMotion] Re: Fault Inputs
>
>  
> Hi Tom
> I have done a little more investigation in regard to my estop issue, and I think there are actually a couple of issues.
>
> Firstly, if I am executing a homing routine via my GalHoming.c program and I press the estop button or the reset button on my mach screen, I need to reboot the kflop via the console to get the system working again. I am assuming this is because it is in the middle of a user "c" program when the estop occured that thread is still actually running. So, do I need to put something in my init program to clear any running threads????
>
> Secondly, as I have mentioned before, if I press my external estop button, mach3 gets this command (I can see this by the status leds on my diagnostics page) but my dro's are still moving, but because mach have disabled my servo's I'm not getting any physical movement. So my question is, how does the kflop get the estop command from mach, is it by some sort of estop flag set by mach internally, or is it in response to an actual button press on the mach screen?
>
> Regards
> Andrew
>
> --- In DynoMotion@yahoogro ups.com, "babinda01" <a_k@> wrote:
> >
> > Hi Tom,
> > No, I havn't sorted this one yet. The estop signal is definetly getting through to mach, on the diagnostics screen you can see the "estop" led toggle and you can also see the "reset" led start blinking, and as a result of this you can see the enable1 led go out and this in turn disables my servo's. BUT..... the DRO's keep moving if the homing "c" program is being run. But if you click the reset button with the mouse, the estop behaves correctly.
> > It is a little odd - I will being some more tests tomorrow.
> >
> > Regards
> > Andrew
> >
> > --- In DynoMotion@yahoogro ups.com, Tom Kerekes <tk@> wrote:
> > >
> > > Hi Andrew,
> > >
> > > Did you ever resolve this?  I'm not sure I follow and Mach3 handles all the estop functionality, but it sounds like maybe the estop is just disabling your amplifiers and not really getting through to Mach3.
> > >
> > > Regards
> > > TK
> > >
> > >
> > >
> > >
> > > ____________ _________ _________ __
> > > From: babinda01 <a_k@>
> > > To: DynoMotion@yahoogro ups.com
> > > Sent: Mon, March 29, 2010 7:43:59 PM
> > > Subject: [DynoMotion] Re: Fault Inputs
> > >
> > >  
> > > Hi Tom
> > >
> > > Don't be sorry, I have trouble understanding myself sometimes.
> > >
> > > I have that issue sorted anyway.
> > >
> > > I have just one more question (for now!).... When I press my estop button, which is connected through to machs estop input. You can see that the machine goes into it's estop state (the reset led flashes) but I don't think is is actually doing the same thing as pressing the reset button on the mach screen.
> > > My thinking behind this is that if you press the reset button on the screen, a message saying that the estop button is pressed flashes up in the status label (very briefly), but if you press the estop button this doesn't happen even though the reset led starts flashing. Also if you are doing a homing proceedure and you press the reset button the motion stops and the dro's stop counting but when you press the estop button the motion stops but the dro's keep counting.
> > >
> > > Any thoughts???
> > >
> > > Regards
> > > Andrew
> > >
> > > --- In DynoMotion@yahoogro ups.com, Tom Kerekes <tk@> wrote:
> > > >
> > > > Hi Andrew,
> > > >
> > > > Sorry I'm having a hard time following all that.
> > > >
> > > > Bit to clear a fault from your drives don't you need to push RESET in Mach3?  In this case maybe you can put the SetBit(159);  at the beginning of the Init program (before this loop) ??
> > > >
> > > > Regards
> > > > TK
> > > >
> > > >
> > > >
> > > >
> > > > ____________ _________ _________ __
> > > > From: babinda01 <a_k@>
> > > > To: DynoMotion@yahoogro ups.com
> > > > Sent: Sun, March 28, 2010 10:48:27 PM
> > > > Subject: [DynoMotion] Fault Inputs
> > > >
> > > >  
> > > > Hi Tom
> > > >
> > > > I have run my machine all day and I have had nice smooth motion and no positional errors, so it looks like the problem is solved.
> > > >
> > > > I am just tidying up a few things and am hoping you can help. In my init program I have the following loop, for my enable circuit.
> > > > Could you please look at it and see if there is a neater/better way of doing it.
> > > > It does work, but I am just not sure it is the correct way of doing things. The SetBit(159) at the end has me worried. To clear a fault from my drives I need to send an enable signal. So to get out of an estop situation, I need to send an enable signal.
> > > > But with what I have below it is possible to have mach NOT outputing an enable 1 signal, but because the estop button isn't pressed or an axis hasn't faulted then the enable relay is forced on (not very good practice).
> > > >
> > > > for(;;)
> > > > {
> > > > WaitNextTimeSlice( );
> > > >
> > > > if (ReadBit(144) == ACTIVE_STATE) //Reads the Enable 1 output from mach3.
> > > > {
> > > > SetBit(159); //Sets my enable relay on
> > > > }
> > > > else if (Debounce(ReadBit( 144) != ACTIVE_STATE) )
> > > > {
> > > > ClearBit(159) ;//Sets my enable relay off }
> > > >
> > > > if (!ReadBit(139) ||ReadBit( 140)||ReadBit( 141)||ReadBit( 142)||ReadBit( 143)== ACTIVE_STATE) //if e/stop or Axis fault or spindle fault disable outputs
> > > > {
> > > > SetBit(49); //EStop input in mach3
> > > > }
> > > > else
> > > > {
> > > > ClearBit(49) ;
> > > > SetBit(159); //Sets my enable relay on
> > > >
> > > > }
> > > >
> > > > Regards
> > > > Andrew
> > > >
> > >
> >
>
Group: DynoMotion Message: 289 From: Tom Kerekes Date: 4/5/2010
Subject: Re: Fault Inputs
Andrew,
 
You might try this:
 
while (ReadBit(15) || (ReadBit(144)==0)) ;
or

while (ReadBit(15) && (ReadBit(144)==0)) ;
TK